<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./templates/main-layout.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">

    <ui:define name="metaData">
    </ui:define>

    <ui:define name="title">
        <h:outputText value="#{msg.email_title}"></h:outputText>
    </ui:define>

    <ui:define name="content">
        <f:view>
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <b><font color="#0002b1">Email Form</font></b>
            <br/>
            <br/>
            All fields are required.
            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel styleClass="formLabel" value="#{msg.email_from_label}" for="from" />
                    <h:inputText styleClass="formTextBox" id="from" value="#{email.from}"
                                 title="#{msg.email_from_label}" required="true"
                                 requiredMessage="#{msg.required_email_from_message}"/>
                    <h:message for="from"  errorStyle="color: red" />

                    <h:outputLabel styleClass="formLabel" value="#{msg.email_name_label}"
                                   for="name" />
                    <h:inputText styleClass="formTextBox" id="name" value="#{email.name}"
                                 title="#{msg.email_name_label}" required="true"
                                 requiredMessage="#{msg.required_email_name_message}"/>
                    <h:message for="name"  errorStyle="color: red" />

                    <h:outputLabel styleClass="formLabel" value="#{msg.email_company_label}"
                                   for="company" />
                    <h:inputText styleClass="formTextBox" id="company" value="#{email.name}"
                                 title="#{msg.email_company_label}" required="true"
                                 requiredMessage="#{msg.required_email_company_message}"/>
                    <h:message for="company"  errorStyle="color: red" />

                    <h:outputLabel styleClass="formLabel" value="#{msg.email_subject_label}"
                                   for="subject" />
                    <h:inputText styleClass="formTextBox" id="subject" value="#{email.subject}"
                                 title="#{msg.email_subject_label}" required="true"
                                 requiredMessage="#{msg.required_email_subject_message}"/>
                    <h:message for="subject"  errorStyle="color: red" />

                    <h:outputLabel styleClass="messageLabel" value="#{msg.email_message_label}"
                                   for="message" />
                    <h:inputText styleClass="formTextBox" id="message" value="#{email.message}"
                                 title="#{msg.email_message_label}" required="true"
                                 requiredMessage="#{msg.required_email_message_message}"/>
                    <h:message for="message"  errorStyle="color: red" />

                    <h:commandButton styleClass="formButton" action="#{home.mainMenu}" immediate="true"
                                     value="#{msg.home_button_label}" />
                    <h:commandButton styleClass="formButton" action="#{email.send}"
                                     value="#{msg.send_button_label}"/>
                </h:panelGrid>
            </h:form>
        </f:view>
    </ui:define>

</ui:composition>
